#!/bin/bash
cd `dirname $0`
basepath=$(cd `dirname $0`; pwd)
pid=`ps -ef|grep -w  ordering-platform|grep -v "grep"|awk -F ' ' '{print $2}'`
echo $pid

jstack -l $pid > target/$pid.stack

today=`date --date='0 days ago' +%Y%m%d`

cp -rf target/target$today$pid/
kill -9 $pid
export JAVA_HOME=/home/posp/soft_package/jdk1.8.0_161
mvn clean package -DskipTests
nohup /home/posp/soft_package/jdk1.8.0_161/bin/java -Xms256m -Xmx512m -jar target/ordering-platform-1.0.jar --spring.profiles.active=dev >/dev/null 2>&1 &